<?php
    //$path = \Illuminate\Support\Facades\Route::getCurrentRoute();
    //dump($path);
    $route = \Illuminate\Support\Facades\Route::currentRouteName();
    $preFix = \Illuminate\Support\Facades\Route::getCurrentRoute()->getPrefix();
    $routeFirst = (strpos($route, '.') > 0) ? substr($route, 0, strpos($route, '.')) : $route;
?>
<ul class="list">
   <li>
        <div class="user-info">
            <div class="image"><a href="{{ url('/') }}" class=" waves-effect waves-block"><img src="{{ asset('assets/images/logo.png') }}" alt="User"></a></div>
            <div class="detail">
              <h4> {{Auth::user() -> name}}</h4>
                <small>管理员</small>
            </div>
        </div>
    </li>
    <li class="<?php if($route == 'home') echo 'active open';?>">
        <a href="{{@url('/')}}" class=""><i class="zmdi zmdi-home"></i><span>首页</span></a>
    </li>
    <li class="<?php if(preg_match('/recommend/', $route)) echo 'active open';?>">
        <a href="javascript:void(0);" class="menu-toggle"><i class="zmdi zmdi-swap-alt"></i><span>推荐管理</span> </a>
        <ul class="ml-menu">
            <li class="<?php if($routeFirst == 'recommend') echo 'active';?>"> <a href="{{@url('recommend')}}">幻灯片列表</a> </li>
        </ul>
    </li>
    <li class="<?php if(preg_match('/report/', $route)) echo 'active open';?>">
        <a href="javascript:void(0);" class="menu-toggle"><i class="zmdi zmdi-assignment"></i><span>报告管理</span> </a>
        <ul class="ml-menu">
            <li class="<?php if($routeFirst == 'zk_reports') echo 'active';?>"> <a href="{{@url('zk_reports')}}">智库报告列表</a> </li>
            <li class="<?php if($routeFirst == 'ex_reports') echo 'active';?>"> <a href="{{@url('ex_reports')}}">外部报告列表</a> </li>
            <li class="<?php if($routeFirst == 'user_reports') echo 'active';?>"> <a href="{{@url('user_reports')}}">报告领取记录</a> </li>
        </ul>
    </li>
    <li class="<?php if(preg_match('/activity_ppt/', $route)) echo 'active open';?>">
      <a href="javascript:void(0);" class="menu-toggle"><i class="zmdi zmdi-delicious"></i><span>会议PPT</span> </a>
        <ul class="ml-menu">
            <li class="<?php if($routeFirst == 'activity_ppt') echo 'active';?>"> <a href="{{@url('activity_ppt')}}">PPT列表</a> </li>
        </ul>
    </li>
    <li class="<?php if($routeFirst == 'users') echo 'active open';?>">
        <a href="javascript:void(0);" class="menu-toggle"><i class="zmdi zmdi-account"></i><span>用户管理</span> </a>
        <ul class="ml-menu">
            <li> <a href="{{@url('users')}}">用户列表</a> </li>
        </ul>
    </li>
    <li class="<?php if($preFix == '/auth') echo 'active open';?>">
        <a href="javascript:void(0);" class="menu-toggle"><i class="zmdi zmdi-lock"></i><span>权限管理</span> </a>
        <ul class="ml-menu">
            <li class="<?php if($routeFirst == 'admins') echo 'active';?>"> <a href="{{@url('auth/admins')}}">管理员列表</a> </li>
            <li class="<?php if($routeFirst == 'admins') echo 'active';?>"> <a href="{{@url('auth/roles')}}">角色权限列表</a> </li>
            <li class="<?php if($routeFirst == 'admins') echo 'active';?>"> <a href="{{@url('auth/permissions')}}">权限列表</a> </li>
        </ul>
    </li>
</ul>
